package com.nuedu.corejava.ch8.homework;


public class HomeWork2 {
	private String a;
	private String b;
	
	public HomeWork2(String a, String b) {
		super();
		this.a = a;
		this.b = b;
	}
	public HomeWork2() {
		super();

	}
	public void testException( ) throws  NullPointerException{
	
		if (a==null|b==null) {
			throw new NullPointerException();
		}else {
			System.out.println(a+"  "+b);
		}
	}
	public static void main(String[] args) {
		HomeWork2 homeWork2=new HomeWork2(null,"1");
		try {
			homeWork2.testException();
		} catch (NullPointerException e) {
			e.printStackTrace();
		}
	}

}
